package com.lam.common.components.captcha.instances.anjiCaptcha.service;

import org.springframework.stereotype.Component;

import com.anji.captcha.service.CaptchaCacheService;
import com.lam.common.components.redis.RedisUtil;

@Component
public class CaptchaCacheServiceRedisImpl implements CaptchaCacheService {

	@Override
	public void set(String key, String value, long expiresInSeconds) {
		RedisUtil.set(key, value, expiresInSeconds);
	}

	@Override
	public boolean exists(String key) {
		return RedisUtil.hasKey(key);
	}

	@Override
	public void delete(String key) {
		RedisUtil.del(key);
	}

	@Override
	public String get(String key) {
		return (String) RedisUtil.get(key);
	}

	@Override
	public String type() {
		return "redis";
	}

}
